package com.opensms.eventLogFacade.actions;

import java.sql.Connection;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.opensms.eventLogFacade.dao.SQLEventLogDAO;
import com.opensms.eventLogFacade.dao.StandardSQLEventLogDAO;
import com.opensms.eventLogFacade.vo.EventLogVO;
import com.util.exceptions.InternalErrorException;
import com.util.exceptions.ModelException;
import com.util.sql.TransactionalPlainAction;

public class FindByIdEventLogAction implements TransactionalPlainAction {
	private static Log log = LogFactory.getLog(FindByIdEventLogAction.class);
	
	private long id;

	public FindByIdEventLogAction(long id) {
		this.id = id;
	}

	public Object execute(Connection connection) throws ModelException, InternalErrorException {
		try{
			SQLEventLogDAO dao = new StandardSQLEventLogDAO();
			EventLogVO vo = dao.findById(connection, this.id);
			return vo;
								
		}catch (Exception e){
			throw new InternalErrorException(e);
		}
	}
}
